// 每个reducer都管理自己单独的状态--->方法
import * as Types from '../actionType'
const initialState = {
    supNum: 5,
    oppNum: 8
};
export default function VoteReducer(state = initialState, action) {
    state = JSON.parse(JSON.stringify(state));//深克隆
    switch (action.type) {
        case Types.VOTE_CHANGE_SUPNUM:
            state.supNum++;
            break;
        case Types.VOTE_CHANGE_OPPNUM:
            state.oppNum++;
            break;
    };
    return state;//不写会报undefined或是随时都改变数据
}